<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>show</title>
</head>
<body>
        <div>
            <p>el表达式写法</p>
            <p>username:${userName}</p>
            <p>password:${password}</p>
        </div>
        <div>
            <p>另一种写法 struts2标签</p>
            <p>username:<s:property value="userName"/></p>
            <p>password:<s:property value="password"/></p>
        </div>
        <div>
            <p>session里取数据</p>
            <p>username:${sessionScope.userName}</p>
            <p>password:${sessionScope.password}</p>
        </div>
        <div>
            <p>struts2标签分为ui标签和通用标签&lt;%@ taglib prefix="s" uri="/struts-tags"%&gt; </p>
            <p>ui标签分表单标签，非表单标签和ajax标签</p>
            <p>通用标签有if foreach等</p>
        </div>
        <div>
            <p>表单标签</p>
            <s:form method="POST" action="">
                <p><s:textfield id="userName"/></p>
                <p><s:password name="password"/></p>
            </s:form>
        </div>
        <div>
            <p>通用标签</p>
            <s:iterator value="userList">
                <tr>
                    <th><s:property value="id"/></th>
                    <th><s:property value="name"/></th>
                    <th><s:property value="number"/></th>
                    <th>
                        <s:if test="id%2==1">男</s:if>
                        <s:else>女</s:else>
                    </th>
                </tr>

            </s:iterator>
            <s:iterator value="userList" var="userlist">
                <tr>
                    <th>${userlist.id}</th>
                    <th>${userlist.name}</th>
                    <th>${userlist.number}</th>
                </tr>
            </s:iterator>
        </div>
</body>
</html>
